<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><link rel="stylesheet" href="css/common.css" type="text/css" /><link href="css/adminstyle.css" rel="stylesheet" type="text/css">
<title>管理区域</title>

<script language="javascript" type="text/javascript" src="My97DatePicker/WdatePicker.js"></script>
<script src="js/jquery-1.6.2.min.js"></script>
</head><script>var select2 = new Array(<?=count($departmentList)?>);<?foreach($departmentList as $k=>$v){?>select2[<?=$k?>] = new Array();select2[<?=$k?>][0] = new Option("请选择", "-1");<?foreach($employees[$k] as $k1=>$v1){?>	select2[<?=$k?>][<?=$k1+1?>] = new Option("<?=$v1['name']?>", "<?=$v1['id']?>");<?	}}?>function redirec(x,dx,city){	var temp = dx; 	temp.options.length=0;	for (i=0;i<select2[x].length;i++){		temp.options[i]=new Option(select2[x][i].text,select2[x][i].value);		if (city>0){			if (select2[x][i].value==city){				temp.options[i].selected=true;			}		}	}}</script>

<body><div id="man_zone">
<div style="background-color:#FFFFFF"> <form  name="form" id="theForm"   method="post" action=""> <input name="id" type="hidden" value="<?=$id?>">  <table width="99%" border="0" align="center"  cellpadding="3" cellspacing="1" class="tableborder">       <tr>      <td  class="left_title_2adminssd">投诉分类</td>	      <td  style="background-color:#FFFFFF" colspan="3">	      <select name="type" id="type">	      <?=$typeOptions?>	      </select>	    </td>     </tr>     <tr>      <td  class="left_title_2adminssd" width="12%">投诉人</td>	      <td  style="background-color:#FFFFFF" width="30%">	      <?$user_name="";	      	if(!empty($user)){$user_name =getStr($user, 'english_name').'_'.getStr($user,'phone');}?>		  <input type="text" name="user_name" id="user_name" value="<?=$user_name?>" size="30">唯一识别号:手机、Email均可     	  <input type="hidden" name="user_id" id="user_id" value="<?=getStr($user,'id')?>">	    </td>		<td  class="left_title_2adminssd"  width="12%">对象</td>	      <td  style="background-color:#FFFFFF"  width="30%">	     	 	<select id="order_type" name="order_type">	     	 		<option value="" >请选择</option>					<?=$comlaintTypeOptions?>	     	 	</select>		     		<input type="text" name="target"  id="target"  value="<?=$target?>" size="60">&nbsp;	     		<?if($order_type==COMPLAINT_TYPE_BOOKORDER_TYPE&&$target_id>0){?><a href="BookCourse_info.html?id=<?=$target_id?>" target="_blank">跟踪单</a><?}?>	     	 		     		<?if($order_type==COMPLAINT_TYPE_ORDER_TYPE&&$target_id>0){?><a href="Order_info.html?id=<?=$target_id?>" target="_blank">跟踪单</a><?}?>	     	 		     		<input type="hidden" name="target_id" id="target_id" value="<?=$target_id?>">	     		<br>若是订单或者预约单,请填写完整的订单编号或者预约单编号，保证其唯一性	      </td>     </tr>     <tr bgcolor="#FFFFFF" id="tr_employee"  style="display:''">       <td height="25"  class="left_title_2adminssd">责任员工</td>      <td height="25" colspan="3">部门&nbsp;&nbsp;&nbsp;      <select name="dept_id" id="dept_id"  onChange="redirec(this.value,document.getElementById('employee_id'))"   >        <option value="-1">请选择</option>          <?          foreach ($departmentList as $k=>$v){		  ?>       	   <option value="<?=$k?>"  <?  if (isset($dept_id)){ if ($dept_id==$k){ echo 'selected="selected"';   } } ?> ><?=$v?></option>          <?		  }		  ?>      </select>               员工&nbsp;&nbsp;&nbsp;      <select name="employee_id" id="employee_id" >      </select>      <script>		<?		if (!empty($dept_id)){?>			redirec(document.getElementById('dept_id').value,document.getElementById('employee_id'),<?=$employee_id?>);		 <?			 }		?>	</script>     </td>    <tr bgcolor="#FFFFFF" id="tr_teacher" style="display:''">       <td height="25"  class="left_title_2adminssd">责任教师</td>      <td height="25" colspan="3"><select name="teacher_id"  >        <option value="-1">请选择</option>          <?          foreach ($teacher as $v){		  ?>        <option value="<?=$v['id']?>"  <?  if (isset($teacher_id)){  if ($v['id']==$teacher_id){ echo 'selected="selected"';   }} ?> ><?=$v['serial_number'].'-'.$v['name']?></option>        <?		  }		?>      </select>	</td>    </tr>        </tr>    <tr>      <td  class="left_title_2adminssd">内容</td>      <td  bgcolor="#FFFFFF" colspan="3">     <textarea name="content" rows="5" cols="100"><?=getStr($extract_vars,'content')?></textarea>      </td>      </tr>      <tr>      <td  class="left_title_2adminssd">跟踪人</td>	      <td  style="background-color:#FFFFFF">	      <select name="follow_employee_id">	      	<?=$trackPeopleOptions?>	      </select>	    </td>      <td  class="left_title_2adminssd">状态</td>	      <td  style="background-color:#FFFFFF">	      <select name="status">	      <?=$statusOptions?>	      </select>	    </td>	         </tr>    <tr>      <td  class="left_title_2adminssd">处理意见</td>      <td  bgcolor="#FFFFFF" colspan="3">     <textarea name="follow_content" rows="5" cols="100"><?=getStr($extract_vars,'follow_content')?></textarea>      </td>      </tr>         <tr  style="background-color:#FFFFFF" >      <td colspan="4" align="center" >      &nbsp;&nbsp;&nbsp;      </td>    </tr>
    <tr  style="background-color:#FFFFFF" >      <td colspan="5" align="center" >      <input name="" type="button" class="PublicBot" value="返回" onclick="javaScript:location.href='complaint_lists.html'" />       <?$url = "Complaint_subAdd.html";if(!empty($id)){ $url='Complaint_subUpdate.html'; }  ?>        <input class="PublicBot" name="save" type="button" value="保存" onclick="javaScript:subs('<?=$url?>')"/>           </td>    </tr>    <tr  style="background-color:#FFFFFF" >      <td colspan="4" align="center" >      &nbsp;&nbsp;&nbsp;      </td>
    </tr>  </table>  </form></div></div>
<script>$("#type").change(function(){	var selected_value=$(this).val();	if(selected_value==2){		$("#tr_teacher").css("display",'');		$("#tr_employee").css("display",'none');	}else{		$("#tr_teacher").css("display",'none');		$("#tr_employee").css("display",'');	}})		$(document).ready(	    function()	   {	    	var selected_value=$("#type").val();	    	if(selected_value==2){	    		$("#tr_teacher").css("display",'');	    		$("#tr_employee").css("display",'none');	    	}else{	    		$("#tr_teacher").css("display",'none');	    		$("#tr_employee").css("display",'');	    	}	   });function subs(value){	var user_name = $("#user_name").val();	if(user_name.length==""){		alert('投诉人不能为空');		return;	}	var content = $("#content").val();	if(content==""){		alert('投诉内容不能为空');		return;	}	var order_type = $("#order_type").val();	if(order_type!=""){		var target=$("#target").val();		if(target.length==""){			alert('投诉对象已选择,请填写相应的订单号')			return;		}	}		document.getElementById('theForm').action=value;	document.getElementById('theForm').submit();}var user = new Object();$("#user_name").change(function(){	var user_name=$(this).val();	if(user_name==""){		alert('投诉人不能为空')		return ;	}	var postJsondata ={"user_name":user_name};	$.ajax({		 type:'POST',		 url:'user_getUser.html',		 data:postJsondata,		 dataType: 'json',		 success:user.response,		 async:false	 });		})user.response = function(result){	if(result.success=='fail'){		if(result.num==0){			alert('没有相关用户');			return;		}		if(result.num>1){			alert('相关用户大于1,请增加精确性');			return;		}	}else{		alert('识别用户成功');		var id=result.user_info.id;		$("#user_id").attr("value",id);		return;		}	}$("#order_type").change(function(){	$("#target").trigger("change");})var order = new Object();var bookorder = new Object();$("#target").change(function(){	var target=$(this).val();	if(target==""){		alert('投诉对象不能为空')		return ;	}	var order_type = $("#order_type").val();	if(order_type==""){		alert('请选择投诉对象');		return;	}	if(order_type=='ORDER'){		var postJsondata ={"target":target};		$.ajax({			 type:'POST',			 url:'order_getOrder.html',			 data:postJsondata,			 dataType: 'json',			 success:order.response,			 async:false		 });		}else{		var postJsondata ={"target":target};		$.ajax({			 type:'POST',			 url:'BookCourse_getOrder.html',			 data:postJsondata,			 dataType: 'json',			 success:bookorder.response,			 async:false		});	}	})user.response = function(result){	if(result.success=='fail'){		if(result.num==0){			$("#user_name").attr("value","");			alert('没有相关用户');			return;		}		if(result.num>1){			alert('相关用户大于1,请增加精确性');			return;		}	}else{		alert('识别用户成功');		var id=result.user_info.id;		$("#user_id").attr("value",id);		return;		}	}order.response = function(result){	if(result.success=='fail'){		if(result.num==0){			$("#target").attr("value","");			alert('没有相关订单');			return;		}		if(result.num>1){			alert('相关订单大于1,请增加精确性');			return;		}	}else{		alert('识别订单成功');		var id=result.order_info.id;		$("#target_id").attr("value",id);		return;		}	}bookorder.response = function(result){	if(result.success=='fail'){		if(result.num==0){			$("#target").attr("value","");			alert('没有相关预约单');			return;		}		if(result.num>1){			alert('相关预约单大于1,请增加精确性');			return;		}	}else{		alert('识别预约单成功');		var id=result.order_info.id;		$("#target_id").attr("value",id);		return;		}	}   </script>		</body>
</html>
